import { getActivationConfig } from '../../api/new_user_activity'
export default {
  namespaced: true,
  state: ()=>({
    activationConfig:{}
  }),
  // 通过 this.$store.commit('a/dispatchCount', 10) 进行操作
  mutations: {
    // 示例：setCount(state, val) {}
    setActivationConfig(state, data) {
      state.activationConfig = data
    },
  },
  // 通过 this.$store.dispatch('a/dispatchCount', 10) 进行操作
  actions: {
    // 示例：getProfessions({ state, commit, rootState }, data) {}
    // 获取专业列表
    async getActivationConfig({ state, commit, rootState }, params) {
      let {errcode,errmsg,data} = await getActivationConfig(params).catch(err=>{
        return {errcode:404,errmsg:'网络错误,请重试',data:{}}
      })
      if(errcode!==0){
        this.$message({type:'warning',message:errmsg})
      }
      commit('setActivationConfig',data)
    },
  },
  getters: {}
}
